home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11608 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  977 b 

  1. Path: doors.informatik.uni-siegen.de!plrunu
  2. From: plrunu@informatik.uni-siegen.de (Runu Knips)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Can you overload a constructor?
  5. Date: 15 Mar 1996 13:11:51 GMT
  6. Organization: University of Siegen
  7. Sender: plrunu@doors.informatik.uni-siegen.de (Runu Knips)
  8. Message-ID: <4ibqan$br5@si-nic.hrz.uni-siegen.de>
  9. References: <Do859K.K9B@watserv3.uwaterloo.ca> <31483CDC.4B0C@staff.ichange.com>
  10. NNTP-Posting-Host: doors.informatik.uni-siegen.de
  11.  
  12. Sorry, it is impossible to OVERLOAD a constructor. A constructor
  13. is ALWAYS called, if there is one for a class. And before it
  14. get called, any constructor for superclasses get called.
  15.  
  16. Likewise with the destructor (but the destructor of the super-
  17. classes will be called AFTER the destructor).
  18.  
  19. There are no other functions which behave like this, so it can't
  20. be called overloading. You cannot supress the constructor of
  21. a superclass, but you can overload and supress a virtual function
  22. of a superclass.
  23.  
  24.